#include <windows.h>
#include <stdio.h>
#include "event.h"

void rdb_onAccept(int fd, short events, void* ctx)
{
}

#define TEST_FD_SIZE  6
int main(int argc, char *argv[])
{
	int i=0;
	int fd = 1;
	struct event ev_arr[TEST_FD_SIZE];

	/* Initalize the event library */
	event_init();

	/* Initalize one event */
	//event_set(&evaccept, fd, EV_READ|EV_PERSIST, rdb_onAccept, &evaccept);

	//test add
	for (i=0; i<TEST_FD_SIZE; i++)
	{
		ev_arr[i].fd = i;
		event_set(&ev_arr[i], i, EV_READ|EV_PERSIST, rdb_onAccept, &ev_arr[i]);
		event_add(&ev_arr[i], NULL);
	}
	event_dump(stderr);

	//test del
	{
		event_del(&ev_arr[0]);
		event_del(&ev_arr[3]);
		event_del(&ev_arr[5]);
	}
	event_dump(stderr);

	//test compress
	event_compress();
	event_dump(stderr);

	//event_dispatch();

    return 0;
}
